package com.ruoyi.project.bajiaostar.tOrderStayRecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.bajiaostar.tOrderStayRecord.mapper.TOrderStayRecordMapper;
import com.ruoyi.project.bajiaostar.tOrderStayRecord.domain.TOrderStayRecord;
import com.ruoyi.project.bajiaostar.tOrderStayRecord.service.ITOrderStayRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 变更待结算记录Service业务层处理
 * 
 * @author 写烧糊
 * @date 2024-06-17
 */
@Service
public class TOrderStayRecordServiceImpl implements ITOrderStayRecordService 
{
    @Autowired
    private TOrderStayRecordMapper tOrderStayRecordMapper;

    /**
     * 查询变更待结算记录
     * 
     * @param id 变更待结算记录ID
     * @return 变更待结算记录
     */
    @Override
    public TOrderStayRecord selectTOrderStayRecordById(Long id)
    {
        return tOrderStayRecordMapper.selectTOrderStayRecordById(id);
    }

    /**
     * 查询变更待结算记录列表
     * 
     * @param tOrderStayRecord 变更待结算记录
     * @return 变更待结算记录
     */
    @Override
    public List<TOrderStayRecord> selectTOrderStayRecordList(TOrderStayRecord tOrderStayRecord)
    {
        return tOrderStayRecordMapper.selectTOrderStayRecordList(tOrderStayRecord);
    }

    /**
     * 新增变更待结算记录
     * 
     * @param tOrderStayRecord 变更待结算记录
     * @return 结果
     */
    @Override
    public int insertTOrderStayRecord(TOrderStayRecord tOrderStayRecord)
    {
        tOrderStayRecord.setCreateTime(DateUtils.getNowDate());
        return tOrderStayRecordMapper.insertTOrderStayRecord(tOrderStayRecord);
    }

    /**
     * 修改变更待结算记录
     * 
     * @param tOrderStayRecord 变更待结算记录
     * @return 结果
     */
    @Override
    public int updateTOrderStayRecord(TOrderStayRecord tOrderStayRecord)
    {
        tOrderStayRecord.setUpdateTime(DateUtils.getNowDate());
        return tOrderStayRecordMapper.updateTOrderStayRecord(tOrderStayRecord);
    }

    /**
     * 删除变更待结算记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTOrderStayRecordByIds(String ids)
    {
        return tOrderStayRecordMapper.deleteTOrderStayRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除变更待结算记录信息
     * 
     * @param id 变更待结算记录ID
     * @return 结果
     */
    @Override
    public int deleteTOrderStayRecordById(Long id)
    {
        return tOrderStayRecordMapper.deleteTOrderStayRecordById(id);
    }
}
